package com.carkeeper.service.serviceFallback;

import com.carkeeper.dto.ServiceDTO;
import com.carkeeper.dto.ServiceSubtypeDTO;
import com.carkeeper.service.ServiceFeign;
import com.carkeeper.service.ServiceSubtypeFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: dongxing
 * @date ：Created in 2020/6/1
 * @description ：
 * @version: 1.0
 */
@Component
public class ServiceSubtypeFallbackFactory implements FallbackFactory<ServiceSubtypeFeign> {
    @Override
    public ServiceSubtypeFeign create(Throwable throwable) {
        return new ServiceSubtypeFeign() {
            @Override
            public List<ServiceSubtypeDTO> findAll() {
                return new ArrayList<>();
            }
        };
    }
}
